﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using University.Workshop.DataAccess;
using University.Workshop.Model;
using System.Collections.ObjectModel;

namespace University.Workshop.Business
{
    public static class AllAuctionManager
    {

        public static Collection<ProductAuction> ShowAllAuctions()
        {
            return AuctionDataAccess.AllAuctions();
        }
        public static Collection<Auction> ReturnAllAuctions(long productId)
        {
            Collection<Auction> auction = new Collection<Auction>() ;
            try
            {
                auction.Add(AuctionDataAccess.GetAuctionByproductId(productId));
            }
            catch (Exception ex)
            {
                
                throw new BusinessException("Error in showing auctions",ex);
            }
            return auction;
        }
    }
}
